<template>
  <div>
    <div class="col-sm-6">
      <all-user-files v-ref:alluser :row="row" @select-changed="selected"></all-user-files>
    </div>
    <div class="col-sm-6">
      <div class="flex">
        <strong class="bg-info text-center">可选择的分表信息</strong>
        <split-list v-ref:split :data="row" @refresh="refreshView"></split-list>
        <strong class="bg-info text-center">总表下的分表信息</strong>
        <total-split-list v-ref:totalsplit :data="row" @refresh="refreshAllUser" style="height: 60%;"></total-split-list>
      </div>
    </div>
  </div>
</template>
<script>
  /**
   *发票分配汇总组件
   */
// import * as Util from '../../Util'
  export default {
    title: '总分表管理',
    data () {
      return {
        row: null,
        all: false
      }
    },
    methods: {
      selected (obj) {
        console.log('我还没选你就给我默认了？？？')
        this.row = obj.val
      },
      refreshView () {
        this.$refs.totalsplit.getUpdate(this.row.f_user_id)
        this.refreshAllUser()
      },
      refreshAllUser () {
        this.$refs.alluser.$refs.paged.$refs.cri.search()
        this.$refs.split.search({items: '*', condition: '1=1', tablename: 'V_user_table', orderitem: 'f_userinfo_id'})
        this.$refs.split.ids = []
      }
    }
  }
</script>
